package com.agent.service;

import com.agent.logbean.WebLogBean;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * Created by fangjicai on 2020/5/31.
 * 日志持久化具体实现
 */
@Primary //@Primary表示如果一个接口有多个实现类，优先使用@Primary标注的类
@Service
public class OperationLogServiceImpl implements OperationLogService {

    private static  final  Logger logger = LoggerFactory.getLogger(OperationLogServiceImpl.class);

    @Override
    public void saveOperationLog(WebLogBean webLogBean) {
        //持久化略
       logger.info("用户访问日志", JSON.toJSONString(webLogBean));
    }
}
